# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)

OutletStatus.delete_all
outlet_statuses = OutletStatus.create([
	{ device_name: 'Air Conditioner', outlet_id: '1' , priority: '1' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'TV', outlet_id: '2' , priority: '2' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'Microwave', outlet_id: '3' , priority: '2' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'Coffee Maker', outlet_id: '4' , priority: '3' , status: 'true', user_override: 'false', or_time: Time.now},
	{ device_name: 'XBOX 360', outlet_id: '5' , priority: '3' , status: 'true', user_override: 'false', or_time: Time.now}])

	
UserSetting.delete_all
user_settings = UserSetting.create([
	{boxmanager_id: '1' , loadbox_id: '1' , algorithm_id: '1' , utility_control_lvl: '4' ,
	consumption_preference: '3' , green_input: 'false'}])
	
PowerLog.delete_all
power_logs = PowerLog.create([
{loadbox_id: '1' , logged_at: '10:59:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '-165.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '11:00:00' , power_consumption: '250.0' , ppv: '327' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '600.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '10:59:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '10:59:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'},
{loadbox_id: '1' , logged_at: '10:59:00' , power_consumption: '150.0' , ppv: '315.0' , 
pgrid: '0.0' , net_dollars: '4.00' , net_peak: '500.0' , net_off_peak: '15.0'}])
    
	
UtilitySetting.delete_all
utility_settings = UtilitySetting.create([{peak_start: '10:00:00' ,
	peak_end: '22:00:00' , peak_price: '0.20' , off_peak_price: '0.10' , override_lvl: '4'}])
	
'GreenSimulation.delete_all
green_simulations = GreenSimulation.create([
	{source_id: '1' , logged_at: '00:00:00' , power: '0.0' , sim_hour: '0'},
	{source_id: '1' , logged_at: '01:00:00' , power: '0.0' , sim_hour: '1'},
	{source_id: '1' , logged_at: '02:00:00' , power: '0.0' , sim_hour: '2'},
	{source_id: '1' , logged_at: '03:00:00' , power: '0.0' , sim_hour: '3'},
	{source_id: '1' , logged_at: '04:00:00' , power: '0.0' , sim_hour: '4'},
	{source_id: '1' , logged_at: '05:00:00' , power: '83.0' , sim_hour: '5'},
	{source_id: '1' , logged_at: '06:00:00' , power: '179.0' , sim_hour: '6'},
	{source_id: '1' , logged_at: '07:00:00' , power: '327.0' , sim_hour: '7'},
	{source_id: '1' , logged_at: '08:00:00' , power: '436.0' , sim_hour: '8'},
	{source_id: '1' , logged_at: '09:00:00' , power: '551.0' , sim_hour: '9'},
	{source_id: '1' , logged_at: '10:00:00' , power: '589.0' , sim_hour: '10'},
	{source_id: '1' , logged_at: '11:00:00' , power: '639.0' , sim_hour: '11'},
	{source_id: '1' , logged_at: '12:00:00 , power: '570.0' , sim_hour: '12'},
	{source_id: '1' , logged_at: '13:00:00' , power: '516.0' , sim_hour: '13'},
	{source_id: '1' , logged_at: '14:00:00' , power: '516.0' , sim_hour: '14'},
	{source_id: '1' , logged_at: '15:00:00' , power: '405.0' , sim_hour: '15'},
	{source_id: '1' , logged_at: '16:00:00' , power: '281.0' , sim_hour: '16'},
	{source_id: '1' , logged_at: '17:00:00' , power: '143.0' , sim_hour: '17'},
	{source_id: '1' , logged_at: '18:00:00' , power: '36.0' , sim_hour: '18'},
	{source_id: '1' , logged_at: '19:00:00' , power: '0.0' , sim_hour: '19'},
	{source_id: '1' , logged_at: '20:00:00' , power: '0.0' , sim_hour: '20'},
	{source_id: '1' , logged_at: '21:00:00' , power: '0.0' , sim_hour: '21'},
	{source_id: '1' , logged_at: '22:00:00' , power: '0.0' , sim_hour: '22'},
	{source_id: '1' , logged_at: '23:00:00' , power: '0.0' , sim_hour: '23'}])

Loadbox.delete_all
loadbox = Loadbox.create([{name: 'Loadbox1', boxmanager_id: '0', version_id: '1', interface_id: '1'}])

